package com.qfedu.buy.common.config;

/**
 * @program: MircoDrink
 * @description:
 * @author: Feri(邢朋辉)
 * @create: 2021-01-20 11:17
 */
public class RedisKeyConfig {
    //访问频率限制
    public static final String GATEWAY_PL="llg:gateway:";//追加ip地址
    public static final int GATEWAY_PL_TIME=1; //
    //禁止ip
    public static final String GATEWAY_IP="llg:gatewayjz:";//追加ip地址
    public static final int GATEWAY_IP_TIME=120*60; //秒
    //记录设备、账号、令牌信息
    //当前的账号信息  Redis内存允许的情况下，最多可以存储2.5亿个key
    public static final String USER_TOKEN="llg:login:token:";//令牌，值：账号信息
    public static final String USER_PHONE="llg:login:phone:";//手机号+设备号，值：对应的令牌
    public static final int USER_TOKEN_TIME=1800; //令牌空闲有效期


    //记录购物车商品数量信息
    public static final String CART_NUM="llg:cart:cartnum:";//追加用户id
    public static final int CART_NUM_TIME=120*60; //购物车商品数量有效期

    //下单的分布式锁的key
    public static final String ORDER_GSKU="llg:order:save:";//商品的skuid
    public static final int ORDER_GSKU_TIME=2; //2秒有效期
    //抢购订单的分布式锁key
    public static final String SKILL_ORDER_LOCK="llg:skill:orderlock:";//商品的id
    public static final int SKILL_ORDER_LOCK_TIME=2; //2秒有效期

    //记录抢购活动
    public static final String SKILL_ACTIVITY="llg:skill:activitys";//集合
    public static final int SKILL_ACTIVITY_TIME=3600; //有效期

    //记录抢购活动定义的抢购商品列表
    public static final String SKILL_ACTIVITY_GOODS="llg:skill:actgoods:";//集合追加活动id
    public static final int SKILL_ACTIVITY_GOODS_TIME=3700; //有效期

    //缓存秒杀商品的key -Hash类型集合
    public static final String SKILL_GOODS="llg:skill:goods";//永久有效 清理无用的商品数据
    //记录是否参与过抢购
    public static final String SKILL_USERS="llg:skill:usergoods";//set类型 元素：uid:skillgoodsid

    //记录抢购的订单信息
    public static final String SKILL_ORDER="llg:skill:order:";//追加订单id

    //抢购的下单接口的动态化
    public static final String SKILL_ORDER_URL="llg:skill:orderurl:";//追加uid:gid
    public static final int SKILL_ORDER_URL_TIME=5;
}